package com.itheima.file;

import java.io.File;
import java.io.IOException;

public class Demo3 {
    public static void main(String[] args) throws IOException {
        //fileff();
        //filef2();


    }

    public static void filef2() throws IOException {
        File file=new File("可变参数和stream流\\aaa");
        File file1=new File("可变参数和stream流\\aaa\\a.txt");
        if(!file.exists()){
            file.mkdirs();
        }
        file1.createNewFile();
    }

    public static void fileff() throws IOException {
        File file=new File("可变参数和stream流\\aaa");
        System.out.println("判断是否存在文件夹:");
        boolean exists = file.exists();
        System.out.println(exists);
        boolean directory = file.isDirectory();
        System.out.println("判断是否是文件夹:");
        System.out.println(directory);
        boolean mkdirs = file.mkdirs();
        System.out.println(mkdirs);
        File file1=new File("可变参数和stream流\\aaa\\a.txt");
        boolean exists1 = file1.exists();
        System.out.println("判断是否存在文件:");
        System.out.println(exists1);
        boolean file1File = file1.isFile();
        System.out.println(file1File);
        boolean newFile = file1.createNewFile();
        System.out.println(newFile);
    }
}
